﻿<?php
$game_dir = "/Users/Administrator/Desktop/Vup杀四人局/";
$avatars_dir = $game_dir . "image/fullskin/generals/full/";
$file_name = "";
$url = explode("/", $_SERVER["REQUEST_URI"]);
if (is_array($url) && !empty($url)) {
  $file_name = $url[count($url) - 1];
}
$card_file = $avatars_dir . $file_name;
if (!file_exists($file_name))
{
  if (!file_exists($card_file) || !copy($card_file, $file_name))
  {
    echo("There is no such a avatar!");
    header('HTTP/1.1 404 Not Found');
    exit();
  }
  
}
header("Location: " . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
?>